package com.sanben.rotation.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sanben.rotation.entity.RotationChart;
import com.sanben.rotation.mapper.RotationChartMapper;
import com.sanben.rotation.service.IRotationChartService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author cyh
 * @description: 轮播图表 服务实现类
 * @date: 2020-08-11
 */
@Service
public class RotationChartServiceImpl extends ServiceImpl<RotationChartMapper,RotationChart> implements IRotationChartService {

    @Override
    public List<RotationChart> getHomeList() {
        LambdaQueryWrapper<RotationChart> lambdaQuery = new LambdaQueryWrapper<>();
        lambdaQuery.orderByDesc(RotationChart::getSort)
                .last("limit 5");
        return this.list(lambdaQuery);
    }

}
